<!-- 拒绝品牌申请 -->
 <template>
  <div>
    <el-dialog
      :visible.sync="visible"
      width="50%"
      :before-close="handleClose"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <span slot="title">
        拒绝收录
      </span>
      <el-form
        :model="form"
        label-width="100px"
      >
        <el-form-item
          label-width="100"
          label="拒绝原因"
        >
          <el-input
            height="300px"
            type="textarea"
            maxlength="500"
            resize="none"
            v-model="form.refuseReason"
            placeholder="请输入拒绝原因"
            show-word-limit
          ></el-input>
        </el-form-item>
      </el-form>
      <div
        slot="footer"
        class="dialog-footer"
      >
        <el-button @click="handleClose">取 消</el-button>
        <el-button
          type="primary"
          @click="handleSubmit"
        >确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
 
 <script>
 import { batchChangeStatus } from '@/api/api';
export default {
  name: "BrandrefuseDialog",
  props: {
    Vrefused: {
      type: Boolean,
      default: false,
    },
    id: {
      type: Array,
      default: [],
    },
    pageNo:{
      type: Number,
      default:1
    }
  },
  computed: {
    changeVisible: {
      get() {
        return this.visible;
      },
      set(val) {
        this.visible = val;
      },
    },
    changebrandid: {
        get() {
          return this.brandid;
        },
        set(val) {
          this.brandid = val;
        },
    }
  },
  data() {
    return {
      visible: this.Vrefused,
      form: {
        refuseReason: "",
        ids: this.id,
        status: 2,
      },
      number:this.pageNo
    };
  },
  methods: {
    handleClose() {
      this.visible = false;
      this.$parent.getBrandApplyList(this.number)
      this.$emit("changeIds",[])
      this.$emit("update:Vrefused", false);
      
    },
    async handleSubmit() {
     const res=await batchChangeStatus(this.form);
       if(res.status==200){
         this.$message.success("拒绝成功");
         this.handleClose();
         this.$parent.getBrandApplyList(this.number)
       }else{
         this.$message.error("拒绝失败");
       }
    },
  },
};
</script>
 
 <style>
 .el-textarea__inner {
    min-height: 32.7778px;
    height: 231px;
}
</style>